package com.hec.yygh.sms.controller;

import com.hec.yygh.common.result.R;
import com.hec.yygh.sms.service.SmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/msm")
public class SmsController {

    @Autowired
    private SmsService smsService;

    @PostMapping("/send/{phone}")
    public R send(@PathVariable("phone")String phone){
        Boolean flag = smsService.send(phone);
        if (flag){
            return R.ok();
        }else{
            return R.error();
        }
    }


}
